package com.xmall.sys.define.request.role;

import com.xmall.define.base.BaseUpdateRequest;
import com.xmall.validate.group.AddGroup;
import com.xmall.validate.group.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 请求数据格式：新增/编辑 sys - role
 */
@Data
public class RoleUpdateRequest extends BaseUpdateRequest implements Serializable {

    /**
     * 角色名称
     */
    @NotBlank(message = "名称不能为空", groups = { AddGroup.class, UpdateGroup.class })
    @Min(value = 3, message = "名称长度最少 3 位")
    @Max(value = 20, message = "名称长度最多 20 位")
    private String name;
}
